]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-private: Receive a CoglFramebuffer
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 6 Oct 2018 01:38:11 +0000 (22:38 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 28 Jan 2019 14:35:51 +0000 (12:35 -0200)
Same case of the previous patch; _st_paint_shadow_with_opacity()
uses cogl_get_draw_framebuffer(), and this patch makes it receive
a CoglFramebuffer as a parameter instead.

The cautious reader might notice that this commit apparently goes
against the long-term goal, for it introduces more instances of
cogl_get_draw_framebuffer(). This is not wrong, but these introduced
ones will be removed later on, when ClutterActor.paint() receives
a CoglFramebuffer as a parameter instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283

src/st/st-entry.c
src/st/st-icon.c
src/st/st-label.c
src/st/st-private.c
src/st/st-private.h
src/st/st-shadow.c
src/st/st-theme-node-drawing.c

index 1db8c652c156d50074e2a16410a86634743538d0..909d0377cad5e307c3b690a99e174bab86519a76 100644 (file)
@@ -869,6 +869,7 @@ st_entry_paint (ClutterActor *actor)
 
       if (priv->text_shadow_material != NULL)
         _st_paint_shadow_with_opacity (shadow_spec,
+                                       cogl_get_draw_framebuffer (),
                                        priv->text_shadow_material,
                                        &allocation,
                                        clutter_actor_get_paint_opacity (priv->entry));
index 625f2a8950663d0e745a34b31c94ea8f61e2cd74..b9c92c86ca521bd1732f9e0972d36ecfcb5dbb64 100644 (file)
@@ -176,6 +176,7 @@ st_icon_paint (ClutterActor *actor)
 
           clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
           _st_paint_shadow_with_opacity (priv->shadow_spec,
+                                         cogl_get_draw_framebuffer (),
                                          priv->shadow_pipeline,
                                          &allocation,
                                          clutter_actor_get_paint_opacity (priv->icon_texture));
index 515e34323c863c50bd7a12d5387c0cca26fe184c..84e685705da96868a3f29737d97a5425f9006c83 100644 (file)
@@ -216,6 +216,7 @@ st_label_paint (ClutterActor *actor)
 
       if (priv->text_shadow_pipeline != NULL)
         _st_paint_shadow_with_opacity (shadow_spec,
+                                       cogl_get_draw_framebuffer (),
                                        priv->text_shadow_pipeline,
                                        &allocation,
                                        clutter_actor_get_paint_opacity (priv->label));
index 1068a74ee9524128baa8385808adab14c3c46329..cd080d611b236932d4311210900b4e6247d985c3 100644 (file)
@@ -658,11 +658,11 @@ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
 
 void
 _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
+                               CoglFramebuffer *framebuffer,
                                CoglPipeline    *shadow_pipeline,
                                ClutterActorBox *box,
                                guint8           paint_opacity)
 {
-  CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
   ClutterActorBox shadow_box;
   CoglColor color;
 
@@ -678,7 +678,8 @@ _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
                             shadow_spec->color.alpha * paint_opacity / 255);
   cogl_color_premultiply (&color);
   cogl_pipeline_set_layer_combine_constant (shadow_pipeline, 0, &color);
-  cogl_framebuffer_draw_rectangle (fb, shadow_pipeline,
+  cogl_framebuffer_draw_rectangle (framebuffer,
+                                   shadow_pipeline,
                                    shadow_box.x1, shadow_box.y1,
                                    shadow_box.x2, shadow_box.y2);
 }
index 3bd934d0085f45d0a1743c4956369fb8aafc47e4..f88f93009477f014e05f56704639df7fbf38c9c6 100644 (file)
@@ -70,6 +70,7 @@ cairo_pattern_t *_st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
                                                   cairo_pattern_t *src_pattern);
 
 void _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
+                                    CoglFramebuffer *framebuffer,
                                     CoglPipeline    *shadow_pipeline,
                                     ClutterActorBox *box,
                                     guint8           paint_opacity);
index 73aa1a3a27af5fec9993b3a05ae361ce26874672..02824002264df406c89656a7db31bab1b3b88494 100644 (file)
@@ -288,6 +288,7 @@ st_shadow_helper_paint (StShadowHelper  *helper,
                         guint8           paint_opacity)
 {
   _st_paint_shadow_with_opacity (helper->shadow,
+                                 cogl_get_draw_framebuffer (),
                                  helper->pipeline,
                                  actor_box,
                                  paint_opacity);
index a414cfef76d64884a3ca07c877dbc53b59974351..967f0a96c8be58466cb8d520c23d6d3da0a4299c 100644 (file)
@@ -2564,6 +2564,7 @@ st_theme_node_paint (StThemeNode           *node,
       if (state->alloc_width < node->box_shadow_min_width ||
           state->alloc_height < node->box_shadow_min_height)
         _st_paint_shadow_with_opacity (node->box_shadow,
+                                       framebuffer,
                                        state->box_shadow_pipeline,
                                        &allocation,
                                        paint_opacity);
@@ -2637,6 +2638,7 @@ st_theme_node_paint (StThemeNode           *node,
        */
       if (node->background_shadow_pipeline != NULL)
         _st_paint_shadow_with_opacity (node->background_image_shadow,
+                                       framebuffer,
                                        node->background_shadow_pipeline,
                                        &background_box,
                                        paint_opacity);